const defaultState = {
  width: null,
};

const state = () => {
  return defaultState;
};

const mutations = {
  leftpopWidthChange(state: typeof defaultState, width: any) {
    state.width = width;
  },
};

const actions = {
  changeLeftpopWidth(context: any, width: any) {
    context.commit("leftpopWidthChange", parseInt(width));
  },
};

const getters = {
  currentWidth(state: typeof defaultState) {
    return state.width;
  },
};

export default {
  namespaced: true,
  state,
  mutations,
  actions,
  getters,
};
